#include <libsyscall.h>

__attribute__((naked)) uint64_t enter_syscall(uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t idx)
{
    __asm__ __volatile__(
        "mv a7, a5\n\t"   /* 把第6个参数 idx（在 a5）移到 a7（syscall 编号） */
        "ecall\n\t"       /* 触发环境调用 */
        "ret\n\t"
    );
}

